<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="/static/css/core.css" type="text/css"/>
    <!-- 特别注意: <script>没有半闭合标签</script> -->
    <script src="/static/js/jquery-3.5.1.min.js"></script>
</head>
<body>
    <div id="list">

    </div>

    <script>
        $(function () {
            $.ajax({
                type: 'post'
                ,url: '${pageContext.request.contextPath}/user/listUser'
                ,data: {}
                ,dataType: 'json'
                ,success: function (res) {
                    let html = '<table>';
                    html += '<tr>';
                    html += '<td>编号</td>';
                    html += '<td>账号</td>';
                    html += '<td>昵称</td>';
                    html += '<td>创建时间</td>';
                    html += '<td>状态</td>';
                    html += '</tr>';
                    for (let user of res) {
                        html += '<tr>';
                        html += '<td>' + user.uniqueCode + '</td>';
                        html += '<td>' + user.account + '</td>';
                        html += '<td>' + user.nickName + '</td>';
                        html += '<td>' + user.createTime + '</td>';
                        html += '<td>' + user.deleted + '</td>';
                        html += '</tr>';
                    }
                    $('#list').html(html);
                }
                ,complete: function () {

                }
            })

        })
    </script>
</body>
</html>
